#define _CRT_SECURE_NO_WARNINGS 1

#include "Stack.h"

void StackTest1()
{
	Stack st;
	StackInit(&st);
	StackPush(&st, 1);
	StackPush(&st, 2);
	StackPush(&st, 3);
	StackPush(&st, 7);
	StackPush(&st, 5);
	StackPush(&st, 6);

	int sz = StackSize(&st);
	printf("%d\n", sz);  //6

	StackPop(&st);
	StackPop(&st);

	sz = StackSize(&st);  
	printf("%d\n", sz);   //4

	STDataType x = StackTop(&st);
	printf("%d\n", x);	//7

	StackPop(&st);
	x = StackTop(&st);
	printf("%d\n", x);  //3

	StackPop(&st);
	sz = StackSize(&st);
	printf("%d\n", sz);	//2

	StackPush(&st, 6);
	StackPush(&st, 9);
	StackPush(&st, 10);

	x = StackTop(&st);
	printf("%d\n", x);  //10

	StackPush(&st, 7);
	StackPop(&st);

	StackPush(&st, 7);
	StackPop(&st);

	StackPush(&st, 7);
	StackPop(&st);

	x = StackTop(&st);
	printf("%d\n", x);  //10

	sz = StackSize(&st);
	printf("%d\n", sz);	//5

	StackPop(&st);
	StackPop(&st);
	StackPop(&st);
	StackPop(&st);
	StackPop(&st);

	sz = StackSize(&st);
	printf("%d\n", sz);	//0

	printf("%d", StackEmpty(&st));	//	true

	//StackPop(&st);	//fail

	StackDestroy(&st);


}





int main()
{

	StackTest1();

	return 0;
}















